package main

import (
	"fmt"
	"time"
)

type base struct {
}

func (b *base) spendTime(id int) {
	fmt.Println("start ", id)
	var total int
	for idx := 0; idx < 100; idx++ {
		//fmt.Println(idx)
		total += idx
	}
	fmt.Println("finish ", id)
}
func main() {
	// for i := 0; i < 10; i++ {
	// 	b := base{}
	// 	go b.spendTime(i)
	// }

	var timer = time.NewTicker(3 * time.Second)
	for {
		select {
		case <-timer.C:
			fmt.Println(time.Now())
			goto FINISH
		}
	}
FINISH:
	fmt.Println("finish")
}
